package com.usian.user.feign;

import com.usian.model.article.pojos.ApAuthor;
import com.usian.model.common.dtos.ResponseResult;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;

/**
 * ClassName: ArticleFeign
 * Author:   WGG
 * Date:    2022-11-2022/11/14-20:06
 * Version: 1.0
 * Description:
 */
@FeignClient("leadnews-article")
public interface ArticleFeign {

    /**
     * 根据用户id查询作者信息
     * @param id
     * @return
     */
    @GetMapping("/article/api/v1/findByUserId/{id}")
    public ApAuthor findByUserId(@PathVariable("id") Integer id);

    /**
     * 根据id查询作者信息
     * @param id
     * @return
     */
    @GetMapping("/article/api/v1/findById/{id}")
    public ApAuthor findById(@PathVariable("id") Integer id);
    /**
     * 保存作者
     * @param apAuthor
     * @return
     */
    @PostMapping("/article/api/v1/save")
    public ResponseResult save(@RequestBody ApAuthor apAuthor);
}
